

//导航栏三横
$(function () {
  let $menuBtn = $(".menuBtn").eq(0);
  let $nav = $("#header .theme");
  let off = false;
  $menuBtn.click(function () {
    if (off) {
      $menuBtn.removeClass("onBtn");
      $nav.removeClass("hide");
      off = !off;
    } else {
      $(this).toggleClass("onBtn");
      $nav.toggleClass("hide");
      off = !off;
    }
  });
  $(window).scroll(function () {
    if (off) {
      $menuBtn.removeClass("onBtn");
      $nav.css("display", "none");
      off = !off;
    }
  });
});
//搜索框
$(function () {
  var $searvh = $("#header .search");
  var $search_con = $("#header .search_con");
  var $search_gb = $("#header .search_con .search_gb");
  $searvh.click(function () {
    $search_con.toggleClass("active");
  });
  $search_gb.click(function () {
    $search_con.removeClass("active");
  });
});
//二级导航栏
$(function () {
  var $twoNavigationLi = $(".two_navigation .container ul li");
  console.log('$twoNavigationLi',$twoNavigationLi.eq(0)[0].innerText.length);
  for (let i = 0; i < $twoNavigationLi.length; i++) {
    if ($twoNavigationLi.eq(i)[0].innerText.length>13) {
      $twoNavigationLi.eq(i).css("min-width", "240px");
    }else if ($twoNavigationLi.eq(i)[0].innerText.length>10) {
      $twoNavigationLi.eq(i).css("min-width", "200px");
    }else if ($twoNavigationLi.eq(i)[0].innerText.length>8) {
      $twoNavigationLi.eq(i).css("min-width", "170px");
    }else if ($twoNavigationLi.eq(i)[0].innerText.length>5) {
      $twoNavigationLi.eq(i).css("min-width", "140px");
    }else if ($twoNavigationLi.eq(i)[0].innerText.length>4) {
      $twoNavigationLi.eq(i).css("min-width", "130px");
    }
    
  }
});
